<template>
	<view class="content" style="background-color: #f9f3c1;">
		<image style="
		position: absolute;
		width: 100%;
		height: 620rpx;" 
		mode="aspectFit"
		src="https://mp-7c5f2fa7-1d2c-41f1-b3dd-1f45e490fd36.cdn.bspapp.com/2024/08/14/21377906-23179634-c20e44e0d37ef29015cca9866d147ed.png"></image>
		<!-- <image style="margin: 0 auto;" v-if="shownews" src="http://www.hngsxy.com/projectresources/wxapp/news/llll1.gif"></image> -->
		<view v-if="item.newsId" @click="goxw(item)" class="media-item view" :key="index" hover-class="media-item-hover" v-for="(item,index) in reslist">
			<!-- <navigator :url="'../details/details?newsId=' + item.newsId"> -->
				<view class="view">
					<text v-text="item.newsTitle" class="media-title"></text>
					<!-- <image style="width: 100%;" :src="itme.newsCarouselPath" mode="scaleToFill"></image> -->
					<image class="imageIon" :src="item.newsCarouselPath"/>
				</view>
				<view class="media-foot flex-row" style="flex-direction: row;float: left;">
					<view class="media-info flex-row" style="flex-direction: row;">
						<text class="info-text">{{item.newsAuthor}}</text>
						<text class="info-text">点击数:{{item.newsVisitConut}}</text>
						<text class="info-text">{{item.newsReleaseTime}}</text>
					</view>
				</view>
				<view class="media-item-line"></view>
			<!-- </navigator> -->
		</view>
		<page-head :title="temp01"></page-head>
	</view>
</template>

<script>
	// import uniList from "@/components/uni-list/uni-list.vue"
	// import uniListItem from "@/components/uni-list-item/uni-list-item.vue"
	var _this;
	export default {
		components: {},
		data() {
			return {
				temp01: '刷新中...',
				shownews: true,
				reslist: [],
				title: '专业介绍',
				newsType: '',
				contentText: {
					contentdown: '查看更多',
					contentrefresh: '加载中',
					contentnomore: '没有更多'
				}
			}
		},
		onLoad(options) {
			_this = this
			this.newsType = options.newsType
			
			uni.setNavigationBarTitle({
				title: '专业介绍'
			});
			
			_this.NewsList('ZSW4')
		},
		onPullDownRefresh() {//上啦加装
			_this.reslist = []
			_this.NewsList('ZSW4')
			this.shownews = true
			this.temp01 = '刷新中...'
		},
		methods: {
			goxw(item){
				vk.navigateTo({
					url: '/pages_bd/details/details?newsId='+item.newsId
				});
			},
			NewsList(newsType) {
				uni.request({
					//url:'https://172.16.1.80:8087/gsxyNews/gsxyNewsList',
					url:'https://www.hngsxy.com/mybatisplus/gsxyNews/gsxyNewsList',
					// url:'http://localhost:8080/gsxyNews/gsxyNewsList2',
					data:{
						newType: newsType
					},
					success: (res) => {
						// console.log(res.data)
						setTimeout(function() {
							_this.reslist = res.data
							_this.shownews = false
							_this.temp01 = '到底了'
						},666)
						uni.stopPullDownRefresh()
					},
					fail: (res) => {
						console.log("未知错误");
					}
				})
				
				// uni.addInterceptor('request', {
				//   invoke(args) {
				// 	// request 触发前拼接 url 
				// 	console.log('interceptor-args',args)
				// 	//args.url = 'https://www.example.com/'+args.url
				//   },
				//   success(args) {
				// 	// 请求成功后，修改code值为1
				// 	console.log('interceptor-args',args)
				//   }, 
				//   fail(err) {
				// 	console.log('interceptor-fail',err)
				//   }, 
				//   complete(res) {
				// 	console.log('interceptor-complete',res)
				//   }
				// })
				
			},

		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		background-color: white;
/* 		align-items: center;
		justify-content: center; */
	}
	.view {
		position: relative;
		flex-direction: column;
	}

	.flex-row {
		flex-direction: row;
	}

	.flex-col {
		flex-direction: column;
	}

	.list-cell {
		width: 750upx;
		padding: 0 30upx;
	}

	.uni-list-cell-hover {
		background-color: #eeeeee;
	}

	.media-item {
		top: 400rpx;
		position: relative;
		background-color: white;
		flex: 1;
		flex-direction: column;
		padding: 20rpx 30rpx 21rpx 30rpx;
		width: 95%;
		margin: 10px;
		border-radius: 5px;
/* 		top:100rpx;
		position: relative;
		flex: 1;
		flex-direction: column;
		padding: 20upx 30upx 21upx 30upx; */
	}

    .media-item-hover{
        background-color: #eee;
    }

	.media-item-line {
		position: absolute;
		left: 30upx;
		right: 30upx;
		bottom: 0;
		height: 2.5upx;
		/* background-color: #888888; */
	}

	.media-image-right {
		flex-direction: row;
	}

	.media-image-left {
		flex-direction: row-reverse;
	}

	.media-title {
		flex: 1;
	}

	.media-title {
		lines: 3;
		text-overflow: ellipsis;
		font-size: 30upx;
		color: #555555;
	}

	.media-title2 {
		flex: 1;
		margin-top: 6upx;
		line-height: 40upx;
	}

	.image-section {
		margin-top: 20upx;
		flex-direction: row;
		justify-content: space-between;
	}

	.image-section-right {
		margin-top: 0upx;
		margin-left: 10upx;
		width: 225upx;
		height: 146upx;
	}

	.image-section-left {
		margin-top: 0upx;
		margin-right: 10upx;
		width: 225upx;
		height: 146upx;
	}

	.image-list1 {
		width: 690upx;
		height: 481upx;
	}

	.image-list2 {
		width: 225upx;
		height: 146upx;
	}

	.image-list3 {
		width: 225upx;
		height: 146upx;
	}

	.media-info {
		flex-direction: row;
		align-items: center;
	}

	.info-text {
		margin-right: 20upx;
		color: #999999;
		font-size: 24upx;
	}

	.media-foot {
		margin-top: 25upx;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.max-close-view {
		position: relative;
		align-items: center;
		flex-direction: row;
		width: 40upx;
		height: 30upx;
		line-height: 30upx;
		border-width: 1upx;
		border-style: solid;
		border-color: #aaaaaa;
		border-radius: 4px;
		justify-content: center;
		text-align: center;
	}

	.close-l {
		position: absolute;
		width: 18upx;
		height: 1upx;
		background-color: #aaaaaa;
	}

	.close-h {
		transform: rotate(45deg);
	}

	.close-v {
		transform: rotate(-45deg);
	}
	.example-body {
		padding: 30upx;
		background: #fff
	}
	.example-body {
		padding: 10upx 30upx;
	}
	.imageIon {
/* 		float: right;
		width: 110upx;
		height: 110upx; */
		float: right;
		width: 120px;
		height: 100px;
	}
</style>